﻿
new Vue({
    el: '#app',
    delimiters:['[[', ']]'],

    data: {
        gift_id: {{ gift.id }},
        // gift_bundle_id: '{{ gift.bundle_id }}',
        gift_name: '{{ gift.name }}',
        gift_price: '{{ gift.price }}',
        gift_orderno: '{{ gift.orderno }}',
        gift_icon: '{{ gift.icon }}',
        gift_resource: '{{ gift.resource }}',
    },

    methods: {
        saveGiftInfo() {
            let url = "{% url 'gma:api_edit_gift' %}";
            let data = {
                'gift_id' : this.gift_id,
                // 'gift_bundle_id' : this.gift_bundle_id,
                'gift_name' : this.gift_name,
                'gift_price' : this.gift_price,
                'gift_orderno' : this.gift_orderno,
                'gift_icon' : this.gift_icon,
                'gift_resource' : this.gift_resource,
            };
            new my_ajax(url, data, '', '', () => {
                show_toast('修改成功');
                redirect();
            });
        },

        cancel() {
            window.history.back();
        },
    },

    mounted() {
    },
});
